#include <iostream>
#include <unordered_set>
#include <algorithm>
using namespace std;

int main() {
	
	int n;
	cin>>n;
	unordered_set<string> has;
	while(n--){
		string str;
		cin>>str;
		sort(str.begin(),str.end());
		has.insert(str);
	}
	cout<<has.size()<<endl;
	
	return 0;
}
